|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
AxisEmitterBasedWSCFContext.java | 0% | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
|
|
17 |
package org.apache.geronimo.ews.ws4j2ee.context.webservices.server;
|
|
18 |
|
|
19 |
import org.apache.axis.wsdl.fromJava.Emitter;
|
|
20 |
import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
|
|
21 |
import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext;
|
|
22 |
import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFWebserviceDescription;
|
|
23 |
import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* @author Srinath Perera(hemapani@opensource.lk)
|
|
27 |
* @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext
|
|
28 |
*/
|
|
29 |
public class AxisEmitterBasedWSCFContext extends AbstractWSCFContext implements WSCFContext { |
|
30 |
private Emitter emitter;
|
|
31 |
private J2EEWebServiceContext j2eeweserviceContext;
|
|
32 |
|
|
33 | 0 |
public AxisEmitterBasedWSCFContext(Emitter emitter, J2EEWebServiceContext j2eeweserviceContext) {
|
34 | 0 |
this.emitter = emitter;
|
35 | 0 |
this.j2eeweserviceContext = j2eeweserviceContext;
|
36 |
} |
|
37 |
|
|
38 |
/* (non-Javadoc)
|
|
39 |
* @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext#getDescription()
|
|
40 |
*/
|
|
41 | 0 |
public String getDescription() {
|
42 | 0 |
throw new UnsupportedOperationException(); |
43 |
} |
|
44 |
|
|
45 |
/* (non-Javadoc)
|
|
46 |
* @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext#getDisplayName()
|
|
47 |
*/
|
|
48 | 0 |
public String getDisplayName() {
|
49 | 0 |
throw new UnsupportedOperationException(); |
50 |
} |
|
51 |
|
|
52 |
/* (non-Javadoc)
|
|
53 |
* @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext#getLargeIcon()
|
|
54 |
*/
|
|
55 | 0 |
public String getLargeIcon() {
|
56 | 0 |
throw new UnsupportedOperationException(); |
57 |
} |
|
58 |
|
|
59 |
/* (non-Javadoc)
|
|
60 |
* @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext#getSmallIcon()
|
|
61 |
*/
|
|
62 | 0 |
public String getSmallIcon() {
|
63 | 0 |
throw new UnsupportedOperationException(); |
64 |
} |
|
65 |
|
|
66 |
/* (non-Javadoc)
|
|
67 |
* @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext#getWebServicesDescription()
|
|
68 |
*/
|
|
69 | 0 |
public WSCFWebserviceDescription[] getWebServicesDescription() {
|
70 | 0 |
throw new UnsupportedOperationException(); |
71 |
} |
|
72 |
|
|
73 | 0 |
public void serialize(java.io.Writer out) throws GenerationFault { |
74 | 0 |
try {
|
75 | 0 |
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
76 | 0 |
out.write("<webservices xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n");
|
77 | 0 |
out.write("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\n");
|
78 | 0 |
out.write("xmlns:ns1=\"http://www.Monson-Haefel.com/jwsbook/BookQuote\n");
|
79 | 0 |
out.write("xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n");
|
80 | 0 |
out.write("http://www.ibm.com/standards/xml/webservices/j2ee/j2ee_web_services_1_1.xsd\" version=\"1.1\">\n");
|
81 | 0 |
out.write("<webservice-description>\n");
|
82 | 0 |
out.write("<webservice-description-name>" + emitter.getServiceElementName() + "</webservice-description-name>\n"); |
83 | 0 |
out.write("<wsdl-file>" + j2eeweserviceContext.getMiscInfo().getWsdlFile() + "</wsdl-file>\n"); |
84 | 0 |
out.write("<jaxrpc-mapping-file>" + j2eeweserviceContext.getMiscInfo().getJaxrpcfile() + "</jaxrpc-mapping-file>\n"); |
85 | 0 |
out.write("<port-component>\n");
|
86 | 0 |
out.write("<port-component-name>" + emitter.getPortTypeName() + "</port-component-name>\n"); |
87 | 0 |
out.write("<wsdl-port xmlns:ns1=\"" + j2eeweserviceContext.getWSDLContext().getTargetNSURI() + "\">\n"); |
88 | 0 |
out.write("ns1:" + j2eeweserviceContext.getWSDLContext().getTargetPort().getName());
|
89 | 0 |
out.write("</wsdl-port>\n");
|
90 | 0 |
out.write("<service-endpoint-interface>" + emitter.getCls().getName() + "</service-endpoint-interface>\n"); |
91 | 0 |
out.write("<service-impl-bean>\n");
|
92 |
|
|
93 |
//TODO let usprint the port type name for now here
|
|
94 |
//we got to print the ejb name here parsing the ejb-jar.xml
|
|
95 | 0 |
String ejbName = j2eeweserviceContext.getMiscInfo().getJ2eeComponetLink(); |
96 | 0 |
if (ejbName == null) |
97 | 0 |
ejbName = emitter.getPortTypeName(); |
98 | 0 |
out.write("<ejb-link >" + ejbName + "</ejb-link>\n"); |
99 | 0 |
out.write("</service-impl-bean>\n");
|
100 | 0 |
out.write("</port-component>\n");
|
101 | 0 |
out.write("</webservice-description>\n");
|
102 | 0 |
out.write("</webservices>\n");
|
103 |
} catch (Exception e) {
|
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
} |
|
108 |
|
|